/**
 * Created by surui on 2016/11/17.
 */
'use strict';

/*引用Vue资源*/
import Vue from 'vue'
import Router from 'vue-router'
import Resource from 'vue-resource'

/*引入页面主体组件*/
import App from './components/app.vue'

/*引入页面*/
import IndexPage from './components/contentList/indexPage.vue'
import Detail from './components/details/detail.vue'
import Recharge from './components/details/recharge.vue'
import Order from './components/details/detail/order.vue'
import PayWec from './components/details/detail/payWec.vue'
import Regist from './components/operate/regist.vue'
import Bill from './components/operate/bill.vue'
import BillDetails from './components/operate/billDetails.vue'

//import ActDemo from './components/common/actDEMO.vue'

/*将vue插件加载到vue上*/
Vue.use(Router);
Vue.use(Resource);

/*实例化路由*/
let router = new Router({});

/*路由配置*/
router.map({
    '/404': {
        name: 404,
        component: require('./components/404.vue')
    },
    '/indexPage' : {
        name: 'IndexPage',
    	component: IndexPage
    },
    '/detail': {
        name: 'Detail',
        component: Detail
    },
    '/recharge': {
        name: 'Recharge',
        component: Recharge
    },
    '/order': {
        name: 'Order',
        component: Order
    },
    '/payWec/:key': {
        name: 'PayWec',
        component: PayWec
    },
    /*'/actDemo': {
        name: 'ActDemo',
        component: ActDemo
    }*/
    '/regist': {
        name: 'Regist',
        component: Regist
    },
    '/bill': {
        name: 'Bill',
        component: Bill
    },
    '/billDetails': {
        name: 'BillDetails',
        component: BillDetails
    }
});

/*设置默认路由*/
router.redirect({
    '/': '/indexPage'
});

router.start(App, '#app');